load("@batfish//skylark:junit.bzl", "junit_tests")
load("@batfish//skylark:pmd_test.bzl", "pmd_test")
load("@rules_java//java:java_library.bzl", "java_library")

package(
    default_testonly = True,
    default_visibility = ["//visibility:public"],
)

java_library(
    name = "recovery_testlib",
    srcs = [
        "NonRecoveryCombinedParser.java",
        "RecoveryCombinedParser.java",
        "RecoveryExtractor.java",
    ],
    deps = [
        "//projects/batfish-common-protocol:parser_common",
        "//projects/batfish-common-protocol/src/test/antlr4/org/batfish/grammar/recovery",
        "@maven//:org_antlr_antlr4_runtime",
    ],
)

pmd_test(
    name = "recovery_testlib_pmd",
    lib = ":recovery_testlib",
)

junit_tests(
    name = "tests",
    srcs = glob(["*Test.java"]),
    resources = ["//projects/batfish-common-protocol/src/test/resources/org/batfish/grammar/recovery"],
    deps = [
        ":recovery_testlib",
        "//projects/batfish-common-protocol:common_lib",
        "//projects/batfish-common-protocol:common_testlib",
        "//projects/batfish-common-protocol:parser_common",
        "//projects/batfish-common-protocol/src/test/antlr4/org/batfish/grammar/recovery",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:junit_junit",
        "@maven//:org_antlr_antlr4_runtime",
        "@maven//:org_hamcrest_hamcrest",
    ],
)
